package com.futao.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.cache.annotation.EnableCaching;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author futao
 * Created on 18-6-5-上午10:39.
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ApiModel("用户实体")
@Entity
@Table(name = "futao_user")
@DynamicUpdate
@DynamicInsert
public class User extends IdEntity implements Serializable {

    @ApiModelProperty(value = "名字")
    @Column(name = "name", length = 50)
    private String name;
    public static final String _name = "name";

    @Max(150)
    @Min(1)
    @ApiModelProperty(value = "年龄")
    @Column(name = "age")
    private Integer age;
    public static final String _age = "age";

    /**
     * transient不会进行序列化
     */
    @Column(name = "password")
    @ApiModelProperty(value = "密码")
    private String password;
    public static final String _password = "password";
}
